<extend name="Index::index" />
<block name="title"><title>商品管理</title></block>
<block name="table">
	<div class="agoods_nav">
		<span>商品列表</span>
		<a href="{:U('Goods/add')}"><button style="width:100px;height:40px;border:none;background:#6CCCCB;float:right;margin-right:40px;margin-top:5px;border-radius:10px;color:#2C6787;">添加商品</button></a>
	</div>
	
	<table class="table" border="1" cellspacing="0" cellpadding="5" align="center">
			<tr>
				<th colspan="10">
				 	<form action="{:U('Goods/index')}">
						<input type="text" name="name" />
						<button type="submit">搜索</button>
					</form>
				</th>
			</tr>

			<tr bgcolor="#ccc">
				<th>编号</th>
				<th>商品名</th>
				<th>图片</th>
				<th>价格</th>
				<th>分类</th>
				<th>库存</th>
				<th>上架|下架</th>
				<th>热销|滞销</th>
				<th>新品|旧款</th>
				<th>操作</th>
			</tr>
			<foreach name="list" item="val">
				<tr>
					<td>{$val['gid']}</td>
					<td>{$val['gname']}</td>
					<td><img src="__ROOT__{$val['giname']}" alt=""></td>
					<td>￥:{$val['gp']}</td>
					<td>{$val['cname']}</td>
					<td>{$val['gs']}</td>
					<td width="100px;">
					<if condition="$val['gb'] eq 1">
					<a href="{:U('Goods/bast',['id'=>$val['gid'],'p'=>$p])}"><button style="width:80px;height:40px;border:none;background:#6CCCCB;border-radius:10px;color:#2C6787;">上架</button></a>
					<else/>
					<a href="{:U('Goods/bast',['id'=>$val['gid'],'p'=>$p])}"><button style="width:80px;height:40px;border:none;background:#6CCCCB;border-radius:10px;color:#2C6787;">下架</button></a>
					</if>
				</td>
				<td width="100px;">
					<if condition="$val['ghot'] eq 1">
					<a href="{:U('Goods/hot',['id'=>$val['gid'],'p'=>$p])}"><button style="width:80px;height:40px;border:none;background:#6CCCCB;border-radius:10px;color:#2C6787;">热销</button></a>
					<else/>
					<a href="{:U('Goods/hot',['id'=>$val['gid'],'p'=>$p])}"><button style="width:80px;height:40px;border:none;background:#6CCCCB;border-radius:10px;color:#2C6787;">滞销</button></a>
					</if>
				</td>
				<td width="100px;">
					<if condition="$val['gnew'] eq 1">
					<a href="{:U('Goods/nnew',['id'=>$val['gid'],'p'=>$p])}"><button style="width:80px;height:40px;border:none;background:#6CCCCB;border-radius:10px;color:#2C6787;">新款</button></a>
					<else/>
					<a href="{:U('Goods/nnew',['id'=>$val['gid'],'p'=>$p])}"><button style="width:80px;height:40px;border:none;background:#6CCCCB;border-radius:10px;color:#2C6787;">旧款</button></a>
					</if>
				</td>
					<td><a href="{:U('detail',['id'=>$val['gid'],'p'=>$p])}" style="color:#000;display:block">查看详情</a><a href="{:U('Goods/delete',['id'=>$val['gid'],'p'=>$p])}" style="color:#000;display:block">删除</a></td>
				</tr>
			</foreach>
			<tr>
				<th colspan="10">
				 	{$page}
				</th>
			</tr>
		</table>
</block>

